<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>测试公共验证方法</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
    <input type="text" placeholder="请输入手机号码" id="phoneNum"/>
    <script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
    <script src="./js/valicate.js"></script> 
    <script type="text/javascript">
        $("#phoneNum").bind("blur", function() {
            var validator = new Valicator(); 
            validator.add($(this), 'mobileFormate', '不是一个正确的手机号码格式');
            validator.add($(this), 'minLength:6', '长度超过指定的长度');
            var errorMsg = validator.start();
            errorMsg.map(function(key) {
                console.info(key);
            });
        });
    </script>
</body>
</html>